<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>The Python Tutorial &mdash; Python v2.7 documentation</title>
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '2.7',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="search" type="application/opensearchdescription+xml"
          title="Search within Python v2.7 documentation"
          href="../_static/opensearch.xml"/>
    <link rel="author" title="About these documents" href="../about.html" />
    <link rel="copyright" title="Copyright" href="../copyright.html" />
    <link rel="top" title="Python v2.7 documentation" href="../index.html" />
    <link rel="next" title="1. Whetting Your Appetite 开胃菜" href="appetite.html" />
    <link rel="prev" title="What’s New in Python 2.0" href="../whatsnew/2.0.html" />
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 

  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="appetite.html" title="1. Whetting Your Appetite 开胃菜"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="../whatsnew/2.0.html" title="What’s New in Python 2.0"
             accesskey="P">previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v2.7 documentation</a> &raquo;</li>
 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="the-python-tutorial">
<span id="tutorial-index"></span><h1>The Python Tutorial<a class="headerlink" href="#the-python-tutorial" title="Permalink to this headline">¶</a></h1>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field"><th class="field-name">Release:</th><td class="field-body">2.7</td>
</tr>
<tr class="field"><th class="field-name">Date:</th><td class="field-body">October 04, 2010</td>
</tr>
</tbody>
</table>
<p>Python is an easy to learn, powerful programming language. It has efficient
high-level data structures and a simple but effective approach to
object-oriented programming. Python&#8217;s elegant syntax and dynamic typing,
together with its interpreted nature, make it an ideal language for scripting
and rapid application development in many areas on most platforms.</p>
<p>Python 是一门简单易学的强大编程语言。它有高效的高级数据结构和简单有效的
面向对象编程方式。Python 的优雅语法和动态类型，以及它解释语言的特质，
使其在很多平台上都成为理想的脚本和快速应用开发语言。</p>
<p>The Python interpreter and the extensive standard library are freely available
in source or binary form for all major platforms from the Python Web site,
<a class="reference external" href="http://www.python.org/">http://www.python.org/</a>, and may be freely distributed. The same site also
contains distributions of and pointers to many free third party Python modules,
programs and tools, and additional documentation.</p>
<p>Python 解释器及其扩展标准库的源码和编译版本可以从 Python 的 Web 站点
<a class="reference external" href="http://www.python.org/">http://www.python.org/</a> 免费获得，并且可以自由分发。该站点还提供了很多
免费的第三方 Python 模块、程序和工具，及其附加文档。</p>
<p>The Python interpreter is easily extended with new functions and data types
implemented in C or C++ (or other languages callable from C). Python is also
suitable as an extension language for customizable applications.</p>
<p>Python 解释器可以很容易的通过 C 或者 C++ （或其它可以通过 C 调用的语
言）扩展新的函数和数据类型。Python 也可以作为定制应用的扩展语言。</p>
<p>This tutorial introduces the reader informally to the basic concepts and
features of the Python language and system. It helps to have a Python
interpreter handy for hands-on experience, but all examples are self-contained,
so the tutorial can be read off-line as well.</p>
<p>本手册向读者介绍 Python 语言及其系统的基本知识与概念。配合 Python 解释
器学习会很有帮助，不过所有的例子都已经包括在文中，所以这本手册也可以离
线阅读。</p>
<p>For a description of standard objects and modules, see <a class="reference external" href="../library/index.html#library-index"><em>The Python Standard Library</em></a>.
<a class="reference external" href="../reference/index.html#reference-index"><em>The Python Language Reference</em></a> gives a more formal definition of the language.  To write
extensions in C or C++, read <a class="reference external" href="../extending/index.html#extending-index"><em>Extending and Embedding the Python Interpreter</em></a> and
<a class="reference external" href="../c-api/index.html#c-api-index"><em>Python/C API Reference Manual</em></a>. There are also several books covering Python in depth.</p>
<p>标准对象和模块的詳細介绍请参见 <a class="reference external" href="../library/index.html#library-index"><em>The Python Standard Library</em></a> 。
<a class="reference external" href="../reference/index.html#reference-index"><em>The Python Language Reference</em></a> 提供了更多语言方面的说明。如编写 C 或 C++ 的
扩展，请阅读 <a class="reference external" href="../extending/index.html#extending-index"><em>Extending and Embedding the Python Interpreter</em></a> 和 <a class="reference external" href="../c-api/index.html#c-api-index"><em>Python/C API Reference Manual</em></a> 。这些文档深
入介绍了相关的 Python 知识。</p>
<p>This tutorial does not attempt to be comprehensive and cover every single
feature, or even every commonly used feature. Instead, it introduces many of
Python&#8217;s most noteworthy features, and will give you a good idea of the
language&#8217;s flavor and style. After reading it, you will be able to read and
write Python modules and programs, and you will be ready to learn more about the
various Python library modules described in <a class="reference external" href="../library/index.html#library-index"><em>The Python Standard Library</em></a>.</p>
<p>本手册不会涵盖 Python 的所有功能，也不会解释所用到的所有相关知识。相
反，它介绍了许多 Python 中引人注目的功能，这会对读者掌握这门语言的风
格大有帮助。读过它后，你应该可以阅读和编写 Python 模块和程序，接下来可
以从 <a class="reference external" href="../library/index.html#library-index"><em>The Python Standard Library</em></a> 中进一步学习Python复杂多变的库和模块。</p>
<p>The <a class="reference external" href="../glossary.html#glossary"><em>Glossary</em></a> is also worth going through.</p>
<p><a class="reference external" href="../glossary.html#glossary"><em>Glossary</em></a> 也值得一读。</p>
<ul>
<li class="toctree-l1"><a class="reference external" href="appetite.html">1. Whetting Your Appetite 开胃菜</a></li>
<li class="toctree-l1"><a class="reference external" href="interpreter.html">2. Using the Python Interpreter 使用　Python 解释器</a><ul>
<li class="toctree-l2"><a class="reference external" href="interpreter.html#invoking-the-interpreter">2.1. Invoking the Interpreter 调用解释器</a><ul>
<li class="toctree-l3"><a class="reference external" href="interpreter.html#argument-passing">2.1.1. Argument Passing 参数传递</a></li>
<li class="toctree-l3"><a class="reference external" href="interpreter.html#interactive-mode">2.1.2. Interactive Mode 交互模式</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="interpreter.html#the-interpreter-and-its-environment">2.2. The Interpreter and Its Environment 解释器及其环境</a><ul>
<li class="toctree-l3"><a class="reference external" href="interpreter.html#error-handling">2.2.1. Error Handling 错误处理</a></li>
<li class="toctree-l3"><a class="reference external" href="interpreter.html#executable-python-scripts-python">2.2.2. Executable Python Scripts 执行 Python 脚本</a></li>
<li class="toctree-l3"><a class="reference external" href="interpreter.html#source-code-encoding">2.2.3. Source Code Encoding 源程序编码</a></li>
<li class="toctree-l3"><a class="reference external" href="interpreter.html#the-interactive-startup-file">2.2.4. The Interactive Startup File 交互式环境的启动文件</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="introduction.html">3. An Informal Introduction to Python Python 概要介绍</a><ul>
<li class="toctree-l2"><a class="reference external" href="introduction.html#using-python-as-a-calculator-python">3.1. Using Python as a Calculator 将 Python 当做计算器</a><ul>
<li class="toctree-l3"><a class="reference external" href="introduction.html#numbers">3.1.1. Numbers 数值</a></li>
<li class="toctree-l3"><a class="reference external" href="introduction.html#strings">3.1.2. Strings 字符串</a></li>
<li class="toctree-l3"><a class="reference external" href="introduction.html#unicode-strings-unicode">3.1.3. Unicode Strings Unicode 文本</a></li>
<li class="toctree-l3"><a class="reference external" href="introduction.html#lists">3.1.4. Lists 列表</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="introduction.html#first-steps-towards-programming">3.2. First Steps Towards Programming 编程的第一步</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="controlflow.html">4. More Control Flow Tools 深入流程控制</a><ul>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#if-statements-if">4.1. <tt class="docutils literal"><span class="pre">if</span></tt> Statements <tt class="docutils literal"><span class="pre">if</span></tt> 語句</a></li>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#for-statements-for">4.2. <tt class="docutils literal"><span class="pre">for</span></tt> Statements <tt class="docutils literal"><span class="pre">for</span></tt> 语句</a></li>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#the-range-function-range">4.3. The <tt class="docutils literal"><span class="pre">range()</span></tt> Function <tt class="docutils literal"><span class="pre">range()</span></tt> 函数</a></li>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#break-and-continue-statements-and-else-clauses-on-loops-break-continue-else">4.4. <tt class="docutils literal"><span class="pre">break</span></tt> and <tt class="docutils literal"><span class="pre">continue</span></tt> Statements, and <tt class="docutils literal"><span class="pre">else</span></tt> Clauses on Loops break 和 continue 语句, 以及 循环中的 else 子句</a></li>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#pass-statements-pass">4.5. <tt class="docutils literal"><span class="pre">pass</span></tt> Statements <tt class="docutils literal"><span class="pre">pass</span></tt> 语句</a></li>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#defining-functions">4.6. Defining Functions 定义函数</a></li>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#more-on-defining-functions">4.7. More on Defining Functions 深入函数定义</a><ul>
<li class="toctree-l3"><a class="reference external" href="controlflow.html#default-argument-values">4.7.1. Default Argument Values 参数默认值</a></li>
<li class="toctree-l3"><a class="reference external" href="controlflow.html#keyword-arguments">4.7.2. Keyword Arguments 关键字参数</a></li>
<li class="toctree-l3"><a class="reference external" href="controlflow.html#arbitrary-argument-lists">4.7.3. Arbitrary Argument Lists 可变参数列表</a></li>
<li class="toctree-l3"><a class="reference external" href="controlflow.html#unpacking-argument-lists">4.7.4. Unpacking Argument Lists 参数列表的分拆</a></li>
<li class="toctree-l3"><a class="reference external" href="controlflow.html#lambda-forms-lambda">4.7.5. Lambda Forms Lambda 形式</a></li>
<li class="toctree-l3"><a class="reference external" href="controlflow.html#documentation-strings">4.7.6. Documentation Strings 文档字符串</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="controlflow.html#intermezzo-coding-style">4.8. Intermezzo: Coding Style 插曲：编码风格</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="datastructures.html">5. Data Structures 数据结构</a><ul>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#more-on-lists">5.1. More on Lists 深入列表</a><ul>
<li class="toctree-l3"><a class="reference external" href="datastructures.html#using-lists-as-stacks">5.1.1. Using Lists as Stacks 把链表当作堆栈使用</a></li>
<li class="toctree-l3"><a class="reference external" href="datastructures.html#using-lists-as-queues">5.1.2. Using Lists as Queues 把链表当作队列使用</a></li>
<li class="toctree-l3"><a class="reference external" href="datastructures.html#functional-programming-tools">5.1.3. Functional Programming Tools 函数式编程工具</a></li>
<li class="toctree-l3"><a class="reference external" href="datastructures.html#list-comprehensions">5.1.4. List Comprehensions 列表推导式</a></li>
<li class="toctree-l3"><a class="reference external" href="datastructures.html#nested-list-comprehensions">5.1.5. Nested List Comprehensions 嵌套的列表推导式</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#the-del-statement">5.2. The <tt class="docutils literal"><span class="pre">del</span></tt> statement 删除语句</a></li>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#tuples-and-sequences">5.3. Tuples and Sequences 元组和序列</a></li>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#sets">5.4. Sets 集合</a></li>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#dictionaries">5.5. Dictionaries 字典</a></li>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#looping-techniques">5.6. Looping Techniques 循环技巧</a></li>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#more-on-conditions">5.7. More on Conditions 深入条件控制</a></li>
<li class="toctree-l2"><a class="reference external" href="datastructures.html#comparing-sequences-and-other-types">5.8. Comparing Sequences and Other Types 比较序列和其它类型</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="modules.html">6. Modules 模块</a><ul>
<li class="toctree-l2"><a class="reference external" href="modules.html#more-on-modules">6.1. More on Modules 深入模块</a><ul>
<li class="toctree-l3"><a class="reference external" href="modules.html#executing-modules-as-scripts">6.1.1. Executing modules as scripts 作为脚本来执行模块</a></li>
<li class="toctree-l3"><a class="reference external" href="modules.html#the-module-search-path">6.1.2. The Module Search Path 模块搜索路径</a></li>
<li class="toctree-l3"><a class="reference external" href="modules.html#compiled-python-files-python">6.1.3. &#8220;Compiled&#8221; Python files “编译的” Python 文件</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="modules.html#standard-modules">6.2. Standard Modules 标准模块</a></li>
<li class="toctree-l2"><a class="reference external" href="modules.html#the-dir-function-dir">6.3. The <tt class="docutils literal"><span class="pre">dir()</span></tt> Function <tt class="docutils literal"><span class="pre">dir()</span></tt> 函数</a></li>
<li class="toctree-l2"><a class="reference external" href="modules.html#packages">6.4. Packages 包</a><ul>
<li class="toctree-l3"><a class="reference external" href="modules.html#importing-from-a-package">6.4.1. Importing * From a Package</a></li>
<li class="toctree-l3"><a class="reference external" href="modules.html#intra-package-references">6.4.2. Intra-package References 包内引用</a></li>
<li class="toctree-l3"><a class="reference external" href="modules.html#packages-in-multiple-directories">6.4.3. Packages in Multiple Directories 多重目录中的包</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="inputoutput.html">7. Input and Output 输入和输出</a><ul>
<li class="toctree-l2"><a class="reference external" href="inputoutput.html#fancier-output-formatting">7.1. Fancier Output Formatting 玩转输出格式</a><ul>
<li class="toctree-l3"><a class="reference external" href="inputoutput.html#old-string-formatting">7.1.1. Old string formatting 旧式的字符串格式化</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="inputoutput.html#reading-and-writing-files">7.2. Reading and Writing Files 读写文件</a><ul>
<li class="toctree-l3"><a class="reference external" href="inputoutput.html#methods-of-file-objects">7.2.1. Methods of File Objects 文件对象方法</a></li>
<li class="toctree-l3"><a class="reference external" href="inputoutput.html#the-pickle-module-pickle">7.2.2. The <tt class="docutils literal"><span class="pre">pickle</span></tt> Module   <tt class="docutils literal"><span class="pre">pickle</span></tt> 模块</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="errors.html">8. Errors and Exceptions 错误和异常</a><ul>
<li class="toctree-l2"><a class="reference external" href="errors.html#syntax-errors">8.1. Syntax Errors 语法错误</a></li>
<li class="toctree-l2"><a class="reference external" href="errors.html#exceptions">8.2. Exceptions</a></li>
<li class="toctree-l2"><a class="reference external" href="errors.html#handling-exceptions">8.3. Handling Exceptions 控制异常</a></li>
<li class="toctree-l2"><a class="reference external" href="errors.html#raising-exceptions">8.4. Raising Exceptions 抛出异常</a></li>
<li class="toctree-l2"><a class="reference external" href="errors.html#user-defined-exceptions">8.5. User-defined Exceptions 用户自定义异常</a></li>
<li class="toctree-l2"><a class="reference external" href="errors.html#defining-clean-up-actions">8.6. Defining Clean-up Actions 定义清理行为</a></li>
<li class="toctree-l2"><a class="reference external" href="errors.html#predefined-clean-up-actions">8.7. Predefined Clean-up Actions 预定义清理行为</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="classes.html">9. Classes 类</a><ul>
<li class="toctree-l2"><a class="reference external" href="classes.html#a-word-about-names-and-objects">9.1. A Word About Names and Objects 关于命名和对象的内容</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#python-scopes-and-namespaces-python">9.2. Python Scopes and Namespaces Python 作用域和命名空间</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#a-first-look-at-classes">9.3. A First Look at Classes 初识类</a><ul>
<li class="toctree-l3"><a class="reference external" href="classes.html#class-definition-syntax">9.3.1. Class Definition Syntax 类定义语法</a></li>
<li class="toctree-l3"><a class="reference external" href="classes.html#class-objects">9.3.2. Class Objects 类对象</a></li>
<li class="toctree-l3"><a class="reference external" href="classes.html#instance-objects">9.3.3. Instance Objects 实例对象</a></li>
<li class="toctree-l3"><a class="reference external" href="classes.html#method-objects">9.3.4. Method Objects 方法对象</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="classes.html#random-remarks">9.4. Random Remarks 一些说明</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#inheritance">9.5. Inheritance 继承</a><ul>
<li class="toctree-l3"><a class="reference external" href="classes.html#multiple-inheritance">9.5.1. Multiple Inheritance 多继承</a></li>
</ul>
</li>
<li class="toctree-l2"><a class="reference external" href="classes.html#private-variables">9.6. Private Variables 私有变量</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#odds-and-ends">9.7. Odds and Ends 补充</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#exceptions-are-classes-too">9.8. Exceptions Are Classes Too 异常也是类</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#iterators">9.9. Iterators 迭代器</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#generators">9.10. Generators 生成器</a></li>
<li class="toctree-l2"><a class="reference external" href="classes.html#generator-expressions">9.11. Generator Expressions 生成器表达式</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="stdlib.html">10. Brief Tour of the Standard Library 标准库概览</a><ul>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#operating-system-interface">10.1. Operating System Interface 操作系统接口</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#file-wildcards">10.2. File Wildcards 文件通配符</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#command-line-arguments">10.3. Command Line Arguments 命令行参数</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#error-output-redirection-and-program-termination">10.4. Error Output Redirection and Program Termination 错误输出重定向和程序终止</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#string-pattern-matching">10.5. String Pattern Matching 字符串正则匹配</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#mathematics">10.6. Mathematics 数学</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#internet-access">10.7. Internet Access 互联网访问</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#dates-and-times">10.8. Dates and Times 日期和时间</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#data-compression">10.9. Data Compression 数据压缩</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#performance-measurement">10.10. Performance Measurement 性能度量</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#quality-control">10.11. Quality Control 质量控制</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib.html#batteries-included">10.12. Batteries Included 电池已备</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="stdlib2.html">11. Brief Tour of the Standard Library &#8211; Part II 标准库概览 II</a><ul>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#output-formatting">11.1. Output Formatting 输出格式</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#templating">11.2. Templating 模板</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#working-with-binary-data-record-layouts">11.3. Working with Binary Data Record Layouts 使用二进制记录层</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#multi-threading">11.4. Multi-threading 多线程</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#logging">11.5. Logging 日志</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#weak-references">11.6. Weak References 弱引用</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#tools-for-working-with-lists">11.7. Tools for Working with Lists 列表工具</a></li>
<li class="toctree-l2"><a class="reference external" href="stdlib2.html#decimal-floating-point-arithmetic">11.8. Decimal Floating Point Arithmetic 十进制浮点数算法</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="whatnow.html">12. What Now? 接下来？</a></li>
<li class="toctree-l1"><a class="reference external" href="interactive.html">13. Interactive Input Editing and History Substitution</a><ul>
<li class="toctree-l2"><a class="reference external" href="interactive.html#line-editing">13.1. Line Editing 行编辑</a></li>
<li class="toctree-l2"><a class="reference external" href="interactive.html#history-substitution">13.2. History Substitution 历史回溯</a></li>
<li class="toctree-l2"><a class="reference external" href="interactive.html#key-bindings">13.3. Key Bindings 快捷键绑定</a></li>
<li class="toctree-l2"><a class="reference external" href="interactive.html#alternatives-to-the-interactive-interpreter">13.4. Alternatives to the Interactive Interpreter 其它交互式解释器</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference external" href="floatingpoint.html">14. Floating Point Arithmetic:  Issues and Limitations 浮点数算法：争议和限制</a><ul>
<li class="toctree-l2"><a class="reference external" href="floatingpoint.html#representation-error">14.1. Representation Error 表达错误</a></li>
</ul>
</li>
</ul>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h4>Previous topic</h4>
            <p class="topless"><a href="../whatsnew/2.0.html"
                                  title="previous chapter">What&#8217;s New in Python 2.0</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="appetite.html"
                                  title="next chapter">1. Whetting Your Appetite 开胃菜</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
  <li><a href="../bugs.html">Report a Bug</a></li>
  <li><a href="../_sources/tutorial/index.txt"
         rel="nofollow">Show Source</a></li>
</ul>

          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="appetite.html" title="1. Whetting Your Appetite 开胃菜"
             >next</a> |</li>
        <li class="right" >
          <a href="../whatsnew/2.0.html" title="What’s New in Python 2.0"
             >previous</a> |</li>
        <li><img src="../_static/py.png" alt=""
                 style="vertical-align: middle; margin-top: -1px"/></li>
        <li><a href="../index.html">Python v2.7 documentation</a> &raquo;</li>
 
      </ul>
    </div>
    <div class="footer">
    &copy; <a href="../copyright.html">Copyright</a> 1990-2010, Python Software Foundation.
    <br />
    The Python Software Foundation is a non-profit corporation.  
    <a href="http://www.python.org/psf/donations/">Please donate.</a>
    <br />
    Last updated on Oct 04, 2010.
    <a href="../bugs.html">Found a bug</a>?
    <br />
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.5.
    </div>

  </body>
</html>